|
Table of Contents
NOTE: you can find this and other lessons in a
more complete and viewable format (including all Figures) in our Tutorial PDF.
Lesson 5. How to Make Your Own Report Titles
-
This lesson teaches you how to specify your own report titles. The control statement discussed is:
-
the
TITLE
statement
How to Use the TITLE Statement
-
As we've seen in the previous lessons, a
TITLE
statement is not required to produce a report. If you do not supply a
TITLE
statement, Spectrum SMF Writer provides a default title.
-
To specify your own report titles, simply use one or more
TITLE
statements. For each
TITLE
statement, Spectrum SMF Writer prints one title line at the top of each page of the report. The title lines print in the same order in which the
TITLE
statements occur.
-
TITLE
statements may appear anywhere after the
INPUT
statement.
-
After the word
TITLE
and the colon, enclosed your desired title text in either single or double quotation marks. For example:
TITLE: 'SPECTRUM SMF WRITER REPORT - CPU TIMES'
-
If your title is too big to fit on a single line, type right up to column 72 in the first line and then continue in column 2 of the next line. Leave column 1 of the continuation line blank.
Adding the Date and Page Number to your Titles
-
You can put more than one item on your
TITLE
statement. And you can also put the contents of fields in your titles.
-
For example, you will probably want to include the date and page number in your titles. Do this by using the special built-in fields named
#DATE
and
#PAGENUM
. (Don't let the pound sign scare you. All of Spectrum SMF Writer's built-in field names begin with this character. This is to distinguish them from fields in your own files that may have similar names.) The contents of the special built-in fields
#DATE
and
#PAGENUM
are, of course, the system date and the current page number:
TITLE: #DATE / 'SPECTRUM SMF WRITER REPORT - CPU TIMES' / 'PAGE' #PAGENUM
-
When using
#DATE
and
#PAGENUM
in your
TITLE
statement, do not enclose them in quotation marks. Anything enclosed in quotation marks is printed as is in the title. Anything not within quotation marks must be the name of a field, whose contents you want in the title.
Built-In Fields Available
-
Here is a table showing the built-in fields available for use in
TITLE
statements:
-
Built-In
Field
|
-
Description
|
-
#DATE
|
-
the system date in a true date field (which you can format any way you like. By default it is formatted as
MM/DD/YY.)
|
-
#DAYNAME
|
-
a character field containing the current day of the week (e.g., "
MONDAY
")
|
-
#TIME
|
-
the system time formatted as a 8-byte, 12-hour
HH:MM AM/PM
character field
|
-
#TIME24
|
-
the system time formatted as a 5-byte, 24-hour
HH:MM
character field
|
-
#HHMMSS
|
-
the system time in a true time field (which you can format any way you like.)
|
-
#JOBNAME
|
-
the name of the job executing Spectrum SMF Writer
|
Putting SMF File Data in the Title
-
As mentioned earlier,
TITLE
statements consist of any mix of literal texts and field names. A field name can be one of Spectrum SMF Writer's built-in fields, as in the earlier example. Or it can be the name of a regular field from the SMF file (or even a
COMPUTE
field). When inserting the contents of a data field into the title, Spectrum SMF Writer uses the data found in the first record used on that report page. Figure _ shows an example of including file data in a title.
How to Align the Title
-
Consider this
TITLE
statement again:
TITLE: #DATE / 'SPECTRUM SMF WRITER REPORT - CPU TIMES' / 'PAGE' #PAGENUM
-
Notice that it contains two slashes (/). These are a powerful formatting device that let you easily align your titles in the customary way without having to carefully count up the number of columns in your report lines. (And then carefully counting them again when you make a minor change to the report.)
-
When slashes are not used, the whole title is centered over the report.
-
But when slashes are used, they divide the title line into three parts. The first part of the title (
#DATE
, in the example above) will be aligned with the left margin of the report. The middle part (the literal text) will be centered over the report. And the last part ("
PAGE
" and
#PAGENUM
) will be aligned with the right margin of the report.
-
Figure _ shows a report that uses a
TITLE
statement similar to the one above.
-
You can also use a single slash in your
TITLE
statement. That results in a 2-part title, where the first part is left-justified and the second part is right-justified.
-
you can also use two slashes but leave one or more of the three title parts "empty". The report in Figure _ shows an example of doing this.
Summary
-
Here is a summary of what we learned in this lesson:
-
use the
TITLE
statement to specify your own titles for a report
-
if more than one
TITLE
statement is used, the title lines print in the same order in which the
TITLE
statements appear
-
use Spectrum SMF Writer's built-in fields to include the date, time, day of the week, and page number in your titles
-
put a field name in the
TITLE
statement to show that field's current value in the title of each page
-
use slashes to separate your title into left, center, and right aligned parts
-
The next lesson will teach you how to customize the formatting of your report.
To Learn More
-
You can also learn:
-
how to print "footnotes" at the bottom of each page of the report
-
the complete syntax for the
TITLE
statement, in .
|